package com.cnhis.cloudhealth.clinical.medical.base.bo;


import com.cnhis.cloudhealth.clinical.medical.base.dao.MmembersDao;
import com.cnhis.cloudhealth.clinical.medical.base.dao.MperformDao;
import com.cnhis.cloudhealth.commons.newid.GetNewId;
import com.cnhis.cloudhealth.commons.utils.GlobalVariable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class MmembersBo {
    @Resource
    private MmembersDao mmembersDao;
    @Autowired
    private GetNewId getNewId;

    /**
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @Description:(获取会员病人需要扣费金额)
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public Map<String, Object> findDeductionAmount(Map map) throws Exception {
        Integer lmode = GlobalVariable.IntegerIsNull(map.get("lmode"));
        if (lmode == 0) {
            return mmembersDao.findDeductionAmount0(map);
        } else {
            return mmembersDao.findDeductionAmount1(map);
        }
    }

    /**
     * @param '[map]'
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @throws
     * @Description:(医技条形码检索、医技刷卡检索)
     * @author chengshaowei
     * @date 2016/9/19 10:30
     */
    public List<Map<String, Object>> findBarcodeOrCard(Map map) throws Exception {
        Integer RateMode = GlobalVariable.IntegerIsNull(map.get("RateMode"));
        if (RateMode == 0) {
            return mmembersDao.findBarcode(map);
        } else {
            return mmembersDao.findMemberscard(map);
        }
    }
}
